define(['require', 'circle1'], function(req, c1) {
    console.log('set up circle2');
    return {
        c2Val: 'c2 value',
        c2FnctA: function(xxx) {
            if (c1 === undefined) {
                // second part of the circle does not work
                console.log('can not see c1 because of circular dependency');
            }
            // special way for the second circular dependency to work
            console.log('c2 seeing c1Val ' + req('circle1').c1Val);
            console.log('c2 calling  c1FnctB ' + req('circle1').c2FnctB());
            console.log('c2.c2Val ' +  this.c2Val + ' ' + xxx);
            return 'c2Funct returned';
        },
        c2FnctB: function() {
            console.log('i am c2FnctB');
        },
    };
});
